/* $RCSFile: ADNCRMRedirect.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.Core/Configuration/Exceptions/ADNCRMRedirect.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:27  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Configuration;
using System.Net;

namespace AddonNice.Configuration
{

    public enum InternalLogLevel { Info, Warn, Error, Fatal };
    
    /// <summary>
	/// Custom Exception class for AddonNice.
	/// </summary>
	// Serializable
	public class ADNCRMRedirect : Exception 
	{
		public ADNCRMRedirect(string redirectUrl, InternalLogLevel level, string message) : base(message)
		{
			Level = level;
			RedirectUrl = redirectUrl;
		}

		public ADNCRMRedirect(InternalLogLevel level, HttpStatusCode statusCode, string message, Exception inner) : base(message, inner)
		{
			Level = level;
			StatusCode = statusCode;
		}

		public ADNCRMRedirect(string redirectUrl, InternalLogLevel level, string message, Exception inner) : base(message, inner)
		{
			Level = level;
			RedirectUrl = redirectUrl;
		}

		public ADNCRMRedirect(string redirectUrl, InternalLogLevel level, HttpStatusCode statusCode, string message, Exception inner) : base(message, inner)
		{
			Level = level;
			StatusCode = statusCode;
			RedirectUrl = redirectUrl;
		}


		private HttpStatusCode _statusCode = HttpStatusCode.NotFound;

        /// <summary>
		/// HttpStatusCode enum
		/// </summary>
		public HttpStatusCode StatusCode
		{
			get{return _statusCode;}
			set{_statusCode = value;}
		}

		private InternalLogLevel _level = InternalLogLevel.Info;
		
        /// <summary>
		/// ExceptionLevel enum
		/// </summary>
		public InternalLogLevel Level
		{
			get{return _level;}
			set{_level = value;}
		}

		private string _redirectUrl = AddonNice.Settings.Config.SmartErrorRedirect;
		public string RedirectUrl
		{
			get{return _redirectUrl;}
			set{_redirectUrl = value;}
		}
	}
}